#ifndef FORMSETGET_H
#define FORMSETGET_H


#include <stdio.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <fcntl.h>
#include <time.h>
#include <QDialog>

//HARD-CODED FOR NOW, BUT THIS IS KEPT AS REFERENCE
// Processing Unit Control Selectors
// (USB_Video_Class_1.1.pdf, A.9.5 Processing Unit Control Selectors)
/*enum PU_CONTROLS
{
PU_CONTROLS
    PU_CONTROL_UNDEFINED,
    PU_BACKLIGHT_COMPENSATION_CONTROL,
    PU_BRIGHTNESS_CONTROL,
    PU_CONTRAST_CONTROL,
    PU_GAIN_CONTROL,
    PU_POWER_LINE_FREQUENCY_CONTROL,
    PU_HUE_CONTROL,
    PU_SATURATION_CONTROL,
    PU_SHARPNESS_CONTROL,
    PU_GAMMA_CONTROL,
    PU_WHITE_BALANCE_TEMPERATURE_CONTROL,
    PU_WHITE_BALANCE_TEMPERATURE_AUTO_CONTROL,
    PU_WHITE_BALANCE_COMPONENT_CONTROL,
    PU_WHITE_BALANCE_COMPONENT_AUTO_CONTROL,
    PU_DIGITAL_MULTIPLIER_CONTROL,
    PU_DIGITAL_MULTIPLIER_LIMIT_CONTROL,
    PU_HUE_AUTO_CONTROL,
    PU_ANALOG_VIDEO_STANDARD_CONTROL,
    PU_ANALOG_LOCK_STATUS_CONTROL
};*/

#define IOCTL_GET            0x80
#define IOCTL_SET            0x90

#define PU_NUM_VALUES 								 19
#define PU_CONTROL_UNDEFINED                       0x00
#define PU_BACKLIGHT_COMPENSATION_CONTROL          0x01
#define PU_BRIGHTNESS_CONTROL               	   0x02
#define PU_CONTRAST_CONTROL                 	   0x03
#define PU_GAIN_CONTROL                            0x04
#define PU_POWER_LINE_FREQUENCY_CONTROL            0x05
#define PU_HUE_CONTROL                             0x06
#define PU_SATURATION_CONTROL                      0x07
#define PU_SHARPNESS_CONTROL                       0x08
#define PU_GAMMA_CONTROL                           0x09
#define PU_WHITE_BALANCE_TEMPERATURE_CONTROL       0x0A
#define PU_WHITE_BALANCE_TEMPERATURE_AUTO_CONTROL  0x0B
#define PU_WHITE_BALANCE_COMPONENT_CONTROL         0x0C
#define PU_WHITE_BALANCE_COMPONENT_AUTO_CONTROL    0x0D
#define PU_DIGITAL_MULTIPLIER_CONTROL              0x0E
#define PU_DIGITAL_MULTIPLIER_LIMIT_CONTROL        0x0F
#define PU_HUE_AUTO_CONTROL                        0x10
#define PU_ANALOG_VIDEO_STANDARD_CONTROL           0x11
#define PU_ANALOG_LOCK_STATUS_CONTROL              0x12

//REQUEST FOR IOCTL_GET
#define GET_NUM_REQUEST_VALUES 4
#define GET_CUR 0x81
#define GET_MIN 0x82
#define GET_MAX 0x83
#define GET_RES 0x84
#define GET_REQUEST_VALUES {GET_CUR, GET_MIN, GET_MAX, GET_RES}


namespace Ui {
class DialogSetGet;
}

class FormSetGet : public QDialog
{
    Q_OBJECT
    
public:
    explicit FormSetGet(QWidget *parent = 0);
    ~FormSetGet();
    void setFile(int file);
    
private slots:
    void on_ComboBoxConfig_currentIndexChanged(int index);
    void on_PushButtonGet_clicked();
    void on_PushButtonSet_clicked();

private:
    Ui::DialogSetGet *ui;
    int currentIndex;
    int fileHandle;
};

#endif // FORMSETGET_H
